//importBeans "applicationContext.xml" //配置脚本里面引入其他配置脚本的方式不推荐，不管是.xml格式还是.groovy格式
import org.hibernate.cfg.Configuration
// import org.hibernate.cfg.SessionFactory
// import org.hibernate.tool.hbm2ddl.SchemaExport

def props = ["792626757@qq.com":"tc3141526", "admin":"admin", "abcd":"1234"]

//configure from classpath
// def oHibntInIOC = new Configuration().configure("conf/hibernate/hibernate.cfg.xml");

beans {
  
  groovyStr(String, "groovy IOC from .groovy")
  xmlStr(String, "groovy IOC from .groovy")
  emptyStr(String)
  
  userTable(LinkedHashMap, props)
  
  hibernateConf(Configuration)
  
  // bean("oHibntCf_inIOC"){bean ->
    // bean.factoryBean="hibernateConf"
    // bean.factoryMethod="configure"
    // prop="conf/hibernate/hibernate.cfg.xml"
  // }
  // bean("oORM_sessionFactory"){bean ->
    // bean.factoryBean="oHibntCf_inIOC"
    // bean.factoryMethod="buildSessionFactory"
  // }
}